package models

import (
	"database/sql"
	"time"
)

const PayChannelWx = "wx"
const PayChannelAlipay = "alipay"

const (
	ORDER_STATE       = iota //订单状态
	STATE_INIT               //初始化订单
	STATE_SUBMIT             //订单已提交
	STATE_PAY_SUCCESS        //订单支付成功
	STATE_PAY_FAIL           //订单支付失败
)

type Order struct {
	ID              uint         `gorm:"primarykey" json:"id"`
	CreatedAt       time.Time    `json:"-"`
	UpdatedAt       time.Time    `json:"-"`
	DeletedAt       sql.NullTime `gorm:"index" json:"-"`
	Amount          float64      `json:"amount"`
	Mobile          string       `json:"mobile" form:"mobile"`
	OrderSn         string       `json:"order_sn" form:"order_sn"`
	OrderState      uint         `json:"order_state"`
	Number          uint         `json:"number" form:"number" binding:"required"`
	CustomerOrderNo string       `json:"customer_order_no" form:"customer_order_no" binding:"required"`
	UserId          string       `json:"user_id" form:"user_id" binding:"required"`
	ProductId       uint         `json:"product_id" form:"product_id" binding:"required"`
	PayChannel      string       `json:"pay_channel" form:"pay_channel"`
}
//提交订单接口（按照产品编码）

//第三方充值返回结果 对象
type name struct {
	
}
func (o Order) BuyOrder() {
	//调用第三方充值接口
}
